﻿using Abp.vNext.WT.WebApi.Contracts.Issues;
using Abp.vNext.WT.WebApi.Contracts.Issues.Dtos;
using Abp.vNext.WT.WebApi.Issues;
using Abp.vNext.WT.WebApi.Issues.MyProject.Issues;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;

namespace My.Application.Issues
{
    public class IssueAppService : ApplicationService, IIssueAppService
    {
        private readonly IIssueRepository _issueRepository;
        private readonly IssueManager _issueManager;

        public IssueAppService(IIssueRepository issueRepository,
            IssueManager issueManager)
        {
            _issueRepository = issueRepository;
            _issueManager = issueManager;
        }

        //[Authorize]
        public async Task<List<IssueDto>> GetListAsync()
        {
            var issues = await _issueRepository.GetListAsync();

            return ObjectMapper.Map<List<Issue>, List<IssueDto>>(issues);
        }

    }
}
